<template>
  <div ref="mm" class="main-nav">
    <!-- 首页导航 -->
    <!-- <header class="header-nav clearfix">
      <ul>
        <li class="logo fl"><img src="/static/images/osp/SEB_logo.png" class="icon"><span>SEB</span></li>
        <li class="user-info fr"><i>欢迎您！</i><span>用户名字</span></li>
      </ul>
    </header> -->
    <div class="main-container">
      <div ref="leftH" class="left-nav">
        <div :class="[{'bg-primary h500': theme == 'ghost' },'row']">
          <t-menu :type="theme" accordion @on-select="toPages">
            <t-submenu name="privilege-management">
              <template slot="title">
                <i class="aid aid-account-multiple"></i>
                权限管理
              </template>
              <t-menu-item name="privilege-definition">权限定义</t-menu-item>
              <t-menu-item name="role-management">角色管理</t-menu-item>
            </t-submenu>
          </t-menu>
        </div>
      </div>
      <div class="layout-main">
        <keep-alive>
          <router-view v-if="true"></router-view>
        </keep-alive>
        <!-- <keep-alive v-if="!this.$router.meta.keepAlive"></keep-alive> -->
        <!-- <router-view></router-view> -->
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      theme: 'light'
    }
  },
  created () {
  },
  mounted () {
    console.log(this.$route.meta)
    this.parentVueFun()
  },
  methods: {
    parentVueFun () {
      document.addEventListener('click', (e) => {
        if (parent.vueFun !== undefined) {
          parent.vueFun()
        }
      }, false)
    },
    toPages(value) {
      if (value === 'privilege-definition') {
        this.$router.push('usermanage/auth')
      }
      if (value === 'role-management') {
        this.$router.push('usermanage/roleManage')
      }
    }
  }
}
</script>
